﻿@{
    var culture = System.Threading.Thread.CurrentThread.CurrentUICulture.Name.ToLowerInvariant();
}

@helper selected(string c, string culture)
{
    if (c == culture)
    {
        @:checked="checked"
    }
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title - My ASP.NET MVC Application</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    @Styles.Render("~/Content/themes/base/css")
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/seriespotter")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryui")
    @Scripts.Render("~/bundles/jqueryval")

</head>
<body>
    <header>
        <div class="content-wrapper">
            <div class="float-left">

                <p class="site-title">  @Html.ActionLink("SerieSpotter", "Index", "Home")</p>
            </div>
            <div class="float-right">
                <section id="login">
                    @Html.Partial("_LoginPartial")
                </section>

                <nav>
                    <ul id="menu">
                        <li>@Html.ActionLink(@Resources.Resource.Home, "Index", "Home")</li>
                        <li>@Html.ActionLink(@Resources.Resource.Series, "Index", "Series")</li>
                        @if (User.IsInRole("admin")) // enkel zitchbaar voor admin
                        {
                            <li>@Html.ActionLink(@Resources.Resource.Adminpaneel, "Index", "AdminPanel")</li>
                        }
                    </ul>
                </nav>
            </div>
        </div>
    </header>
    <div id="body">
        @RenderSection("featured", required: false)
        <section class="content-wrapper main-content clear-fix">
            @RenderBody()
        </section>
    </div>
    <footer>
        <div class="content-wrapper">
            <div class="float-left">
                <p>&copy; @DateTime.Now.Year - My ASP.NET MVC Application</p>
            </div>
            <div class="float-right">
                @using (Html.BeginForm("SetCulture", "Home"))
                {
                    <fieldset>
                        <legend>ChooseYourLanguage</legend>
                        <div class="control-group">
                            <div class="controls">
                                <label for="NL">
                                    <input name="culture" id="nl-BE" value="nl-BE" type="radio" @selected("nl-BE", culture) />
                                    Nederlands
                                </label>
                            </div>
                        </div>
                        <div class="control-group">
                            <div class="controls">
                                <label for="en-us">
                                    <input name="culture" id="en-GB" value="en-GB" type="radio" @selected("en-GB", culture) />
                                    English
                                </label>
                            </div>
                        </div>
                    </fieldset>
                }

            </div>
        </div>
    </footer>

    @Scripts.Render("~/bundles/seriespotter")
    @RenderSection("scripts", required: false)

    <script type="text/javascript">
        (function ($) {
            $("input[type = 'radio']").click(function () {
                $(this).parents("form").submit(); // post form
            });

        })(jQuery);
    </script>

</body>
</html>
